import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/vulnerabilityVerifyProject'

// 查询漏洞验证工程列表
export const getVerifyProjectList = params => {
  return axios({
    url: `${base}/page`,
    method: 'GET',
    headers: jsonHeaders,
    params
  })
}

// 创建漏洞验证工程
export const addVerifyProject = data => {
  return axios({
    url: `${base}/add`,
    method: 'POST',
    headers: jsonHeaders,
    data
  })
}

// 删除漏洞验证工程
export const deleteVerifyProject = data => {
  return axios({
    url: `${base}/delete`,
    method: 'DELETE',
    headers: jsonHeaders,
    data
  })
}

// 修改漏洞验证工程
export const updateVerifyProject = data => {
  return axios({
    url: `${base}/update`,
    method: 'PUT',
    headers: jsonHeaders,
    data
  })
}

// 查询漏洞验证工程关联的漏洞
export const getVulnerabilityVerifyProjectList = params => {
  return axios({
    url: `${base}/vulnerabilityProjectPage`,
    method: 'GET',
    headers: jsonHeaders,
    params
  })
}

// 创建漏洞验证工程关联的漏洞
export const addVulnerabilityVerifyProject = (projectId, data) => {
  return axios({
    url: `${base}/vulnerabilityBindProject/${projectId}`,
    method: 'POST',
    headers: jsonHeaders,
    data
  })
}

// 删除漏洞验证工程关联的漏洞
export const deleteVulnerabilityVerifyProject = data => {
  return axios({
    url: `${base}/deleteVulnerabilityProject`,
    method: 'DELETE',
    headers: jsonHeaders,
    data
  })
}
